package com.alennus.blog.service;

import com.alennus.blog.domain.RoleMenu;
import com.alennus.blog.repository.RoleMenuRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by pactera on 2018/6/11.
 */
@Service
public class RoleMenuService {


    @Autowired
    private RoleMenuRepository roleMenuRepository;



    public List<RoleMenu> saveAll( List<RoleMenu> roleMenus){
        return roleMenuRepository.saveAll(roleMenus);
    }

    public void deleteByRoleId(String roleId){
        roleMenuRepository.deleteByRoleId(roleId);
    }

    public List<RoleMenu> findByRoleId(String roleId){

        return roleMenuRepository.findByRoleId(roleId);
    }


}
